﻿using System.Xml.Linq;

namespace Game
{
	public class 模组设置Screen : Screen
	{
		public Screen m_上一屏;
		public ButtonWidget m_模组设置Button;

		public 模组设置Screen()
		{
			XElement node = ContentManager.Get<XElement>("Screens/SettingsScreen");
			LoadContents(this, node);
			m_模组设置Button = Children.Find<ButtonWidget>("模组设置");

		}

		public override void Enter(object[] parameters)
		{
			if (m_上一屏 == null)
			{
				m_上一屏 = ScreensManager.PreviousScreen;
			}
		}

		private static void 点击切换界面(ButtonWidget button, string screenName)
		{
			if (button.IsClicked)
			{
				ScreensManager.SwitchScreen("Settings"+screenName);
			}
		}
		public override void Update()
		{
			点击切换界面(m_模组设置Button, "命令方块");

			if (Input.Back || Input.Cancel || Children.Find<ButtonWidget>("TopBar.Back").IsClicked)
			{
				ScreensManager.SwitchScreen(m_上一屏);
				m_上一屏 = null;
			}
		}
	}
	public class 正弦计划
	{
			
	}
}
